package com.example.testcentral.designpattern.factorypattern

/**
 * File Name: SimplePizzaFactory
 * Author: zhangzhenzhong
 * Created on: 2024/7/10
 * Description: 工厂  让类把实例化推到子类
 */
abstract class SimplePizzaFactory {
    lateinit var pizza:Pizza
//    abstract fun createPizz(type:String):Pizza

    open fun createPizz(type:String):Pizza{
        when(type){
            "cheess"-> pizza=CheesePizza()
            "clam"-> pizza=ClamPizza()
        }
        return pizza
    }
}